﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;

namespace WebSite_CodeMan
{
    public partial class TMes : System.Web.UI.Page
    {
        protected string[] WebMes = new string[6];
        protected string strRightNote = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadLeave();
            }
        }
        private void GetBaseMes()
        {
            OleDbDataReader DataRead = BLL.WebInfo.GetWebBaseInfo("5");
            if (DataRead.HasRows)
            {
                DataRead.Read(); 
                WebMes[0] = DataRead["T_WebName"].ToString();
                WebMes[1] = DataRead["T_WebKey"].ToString();
                WebMes[2] = DataRead["T_WebDes"].ToString();
                WebMes[3] = DataRead["T_WebWord"].ToString();
                WebMes[4] = DataRead["T_WebLink"].ToString() + "&nbsp;<img src=\"../Images/IBCMes.gif\"/>&nbsp;" + DataRead["T_WebNumber"].ToString() + "&nbsp;" + DataRead["T_SPSSMes"].ToString();
                WebMes[5] = BaseClass.HtmlCommon.GetWebMenu("TMes").ToString();
            }
            DataRead.Close();
            DataRead.Dispose();
            strRightNote = BaseClass.HtmlCommon.HtmlGetTopRndNote().ToString() + BaseClass.HtmlCommon.HtmlGetTopNote() + BaseClass.HtmlCommon.HtmlGetClassMes().ToString() + BaseClass.HtmlCommon.HtmlGetHotKey("20", Page);
        }
        private void LoadLeave()
        {
            GetBaseMes();
            
            int PageCount = 0;
            int RecordCount = 0;
            string strWhere = " WHERE T_NoteClassID='' ";
            RpLeave.DataSource = BLL.NoteInfo.GetAllNoteInfo(PagerTMes.CurrentPageIndex, PagerTMes.PageSize, out PageCount, out RecordCount, strWhere);
            RpLeave.DataBind();
            PagerTMes.RecordCount = RecordCount;
        }

        protected void PagerTMes_PageChanged(object sender, EventArgs e)
        {
            LoadLeave();
        }
    }
}
